/*
--------------------------------------------------------------------------------
				Ak-Lib. 
			 Project       	: Ak-Lib
			 Group         	: Ak-Lib R&D Team
			 Author        	: Ocean.Wang
			 Create Date 	: 05-01-2010
--------------------------------------------------------------------------------
Code Name 	:  A.K 	~v~
Description	:  Yet Another Cross-Platform Lib.
Cautions    	:
--------------------------------------------------------------------------------
Change History:
Version		: 0.1
Building 		: 05/01/10
10-05.01 first draft, build, debug and test.
--------------------------------------------------------------------------------
*/
#ifndef	_INC_AK_SCTP_
#define	_INC_AK_SCTP_

#include "ak_types.h"
#include "ak_socket.h"
#ifdef __cplusplus
extern "C" {
#endif

typedef struct{
	int 	maxStm_In;
	int 	maxStm_Out;
	int 	max_Attempt;
	
	int 	RTO_Initial;
	int 	RTO_Max;
	int 	RTO_Min;
	
	int 	maxRat_Assoc;
	int 	maxRat_Path;
    int 	TO_Heatbeat;
}_t_sockSCTP_Cfg;


extern	S_SOCKET 	SockSctp_Open(unsigned int ip, unsigned short port, _t_sockSCTP_Cfg * config, int bBind);
extern	int 		SockSctp_Close(S_SOCKET sock,  int assocId);
extern	int 		SockSctp_Peer(S_SOCKET sock, int assocId);

extern	int 	SockSctp_Connect(S_SOCKET sock, unsigned int ip, unsigned short port, _e_sockState * rState);
extern	int 	SockSctp_Accept(S_SOCKET sock, _t_cbentry * pCbEntry);


extern	int 	SockSctp_Recv(int 	sockId, _t_cbentry * pCbEntry);
extern	int 	SockSctp_Send(int 	sockId, unsigned char * pMsg, int msgLen, S_SOCKET_ADDRIN * pSockAddr, unsigned int ppId);

extern	int 	SockSctp_Tx(int sockId, unsigned char * pMsg, int msgLen, S_SOCKET_ADDRIN *	pSockAddr);
extern	int 	SockSctp_Rx(int sockId, _t_cbentry * pCbEntry);
extern	int 	SockSctp_RxSel(int sockId, _t_cbentry * pCbEntry, int timeout);


/* SCTP Command */
extern	int 	SSctp_SetTraceLvl(int lvl);
extern	int 	SSctp_GetTraceLvl(void);

#ifdef __cplusplus
}
#endif


#endif




